package Text7;

import java.util.*;

public class Main {
    static int N = 50, n, m;
    static int[] ways = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        dfs(0, 1);
    }

    private static void dfs(int u, int start) {
        if (u == m) {
            for (int i = 0; i < m; i++) {
                System.out.print(ways[i] + " ");
            }
            System.out.println();
            return;
        }
        for (int i = start; i <= n; i++) {
            ways[u] = i;
            dfs(u + 1, i + 1);
            ways[u] = 0;
        }
    }
}
